<template>
  <div class="container">
<!--    <div class="listHeader">
      <image src="http://file.rzkeji.com/web/loveciy/img/luckDraw/luckDrawListImg2.png"></image>
      <image src="http://file.rzkeji.com/web/loveciy/img/luckDraw/luckDrawListImg1.png"></image>
      <image src="http://file.rzkeji.com/web/loveciy/img/luckDraw/luckDrawListImg2.png"></image>
      <button open-type="share" class="share">分享朋友 ></button>
    </div> -->
    <drawList :drawData="allList" :activeType="active"></drawList>
    <image src="http://file.rzkeji.com/web/loveciy/img/footer.jpg" class="footer" mode="aspectFill"></image>
  </div>
</template>

<script>
import drawList from '@/pages/components/drawList/index.vue'
export default {
  components: {
    drawList
  },
  data () {
    return {
      allList:[],
      active:{
        type:"drawList",
        end:{
          endImg:"http://file.rzkeji.com/web/loveciy/img/luckDraw/end.png",
          endDesc:"已开奖"
        },
        start:{
          startImg:"http://file.rzkeji.com/web/loveciy/img/luckDraw/start.png",
          startDesc:"进行中"
        },
        join:{
          joinImg:"http://file.rzkeji.com/web/loveciy/img/luckDraw/start.png",
          joinDesc:"已参与"
        }
      }
    }
  },
  methods:{
    async getListData(){
      var userToken=wx.getStorageSync('userToken');
	  let res=await this.$api.getActivityDraw({user_token:userToken,is_my:0})
      if(res.data.level=='success'){
        this.allList=res.data.data;
      }
    }
  },
  onShow () {
    this.getListData()
  }, 
  onShareAppMessage(res){
    this.$currency.share(res,'抽奖列表','/pages/luckDrawList/main');
  }
}
</script>

<style scoped>
.container{width: 100%;}
.listHeader{width: 100%;height:22.5px;display: flex;justify-content: row;position: relative;padding:10px 0px;}
.listHeader image{height: 22.5px;margin-left: 10px;}
.listHeader image:nth-of-type(1),.listHeader image:nth-of-type(3){width: 75px;}
.listHeader image:nth-of-type(2){width: 25px;}
.share{width: 65px;height: 22.5px;background: transparent;font-size: 12px;padding:0;line-height: 22.5px;color: #666666;text-align: center;position: absolute;right:10px;top: 10px;}
/*.share{margin-top: 20px;}*/
.share::after{border:none;}
.footer{width: 100%;display: block;height: 36px;}
.customerWrap{width: 50px;height: 50px;position: fixed;right: 20px;bottom: 120px;background: rgba(0,0,0,0.5);border-radius: 50px;}
</style>
